package com.newtribe.access;
import java.util.HashMap;

import com.newtribe.access.context.PeerContext;


/**
 * 
 */

/**
 * @author newtribe
 *
 */ 
public class PeerContextFactory {

	private HashMap contextBuffer =new HashMap();

	private static PeerContextFactory instance=new PeerContextFactory();
	
	public static PeerContextFactory getFactory(){
		return instance ;
	}
	
	public synchronized PeerContext getContext (String guid){
		
		PeerContext context =(PeerContext)contextBuffer.get(guid);
		if (context ==null) {
			 context =new PeerContext(guid);
			contextBuffer.put(guid, context);
		}
		return context ;
		
	}

}
